package spr

import (
	pl "db2s/Or/spr/parser"
	"fmt"
	"github.com/antlr4-go/antlr/v4"
	"reflect"
)

func Alias(node antlr.RuleNode) (res string) {
	for _, child := range node.GetChildren() {
		switch childNode := child.(type) {
		case *antlr.TerminalNodeImpl:
		case *pl.Id_expressionContext:
			return childNode.GetText()
		default:
			fmt.Println("default func=Alias():", reflect.TypeOf(childNode), childNode.(antlr.RuleNode).GetText())
		}
	}
	return
}
